﻿var btnSubmit = null;

window.onload = function () {
    btnSubmit = $get("btnSubmit");
    $addHandler(btnSubmit, "click", Function.createDelegate(this, Logon));
};

function Logon() {
    var login = $get("tbName").value;
    var pwd = $get("tbPass").value;
    PageMethods.Logon(login, pwd, LogonSuccess, LogonFail);
}

function LogonSuccess(result) {
    window.location.href = "CustomerCard.aspx?uid=" + result;
}

function LogonFail() {
    alert("Logon fail");
}